#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
class Solution {
public:
    string removeDuplicates(string s)
    {
        string ret;
        for (auto ch : s)
        {
            if (!ret.empty() && ret.back() == ch)
                ret.pop_back();
            else
            {
                ret.push_back(ch);
            }
        }
        return ret;

    }
};